package com.itheima.nosql.entity;

import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.HashMap;
import java.util.Map;

@Document("address")
public class Address {
    @Transient
    private Long id;
    private String name;
    private Map loc;
    
    public Address(String name, int x, int y) {
        this.name = name;
        loc = new HashMap();
        loc.put("type", "Point");
        loc.put("coordinates", new int[]{x, y});
    }
    
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
}
